{include file='public/header.html'}

<div class="container mtn">
	{include file='user/_top_nav.html'}
	<div class="panel panel-default mtn">
		<div class="panel-heading">
			个人中心<span class="pull-right"><a href="javascript:history.back(-1);">返回</a></span>
		</div>
		<div class="panel-body">
			<div class="row">
				<div class="col-md-3">
					<div style="text-align:center;margin-top:5px;">
						{if empty($vo['qq']):}
						<img src="__STATIC__/img/avatar.png" width="80" height="80" class="img-circle" alt="avatar"/>
						{else:}
						<img src="http://q1.qlogo.cn/g?b=qq&nk={$vo.qq}&s=100&t={:time()}" title="QQ{$vo.qq}"  width="80" height="80" class="img-circle" alt="avatar"/>
						{/if}
						<p style="margin-top:15px;"><strong>{$vo.nickname}</strong> v{$vo.level}</p>
					</div>
				</div>
				<div class="col-md-9">
					<div class="form-horizontal user-profile">
						<div class="form-group">
							<label class="col-sm-2 control-label">格言</label>
							<div class="col-sm-10">
								<p class="form-control-static">{$vo.bio|default='暂无'}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">QQ</label>
							<div class="col-sm-10">
								<p class="form-control-static">{$vo.qq|default='暂无'}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">邮箱</label>
							<div class="col-sm-10">
								<p class="form-control-static">{$vo.email|default='暂无'}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">手机</label>
							<div class="col-sm-10">
								<p class="form-control-static">{$vo.mobile|default='暂无'}</p>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">注册时间</label>
							<div class="col-sm-10">
								<p class="form-control-static">{$vo.create_time|date='Y-m-d H:i:s'}</p>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="panel panel-default">
		<div class="panel-heading">
			我的文集 <span class="pull-right"><a href="{:url('book/add')}">发布</a></span>
		</div>
		<div class="panel-body">
			<span class="text-danger">{:site('book_about', '暂无发布说明')}</span>
		</div>
		{php $list=db('book')->where('user_id', $vo['id'])->order('is_top DESC,sort ASC,id DESC')->paginate(10)}
		<table class="table">
			<thead>
			<th>ID</th>
			<th>标题</th>
			<th>类型</th>
			<th>排序</th>
			<th>创建时间</th>
			<th>状态</th>
			<th>操作</th>
			</thead>
			<tbody>
			{foreach $list as $vo}
			{php $start_id=get_start_id($vo['id'])}
			<tr>
				<td>{$vo.id}</td>
				<td>{if $vo['is_top']==1:}<span class="text-danger">置顶</span> {/if}<a href="{:url('doc/read',['id'=>$start_id])}">{$vo.title}</a></td>
				<td>{if $vo['is_public']==1:}公共{else:}私有{/if}</td>
				<td>{$vo.sort}</td>
				<td>{$vo.create_time|get_time_ago}</td>
				<td>
					{if $vo['status']==1:}
					<span class="btn btn-xs btn-success">已启用</span>
					{else:}
					<span class="btn btn-xs btn-default">已停用</span>
					{/if}
				</td>
				<td>
					<a href="{:url('book/edit',['id'=>$vo['id']])}" class="btn btn-xs btn-primary">编辑</a>
					<a href="javascript:ajaxConfirm('{:url('book/del',['id'=>$vo['id']])}','删除',2);" class="btn btn-xs btn-danger">删除</a>
					<a href="{:url('doc/add',['book_id'=>$vo['id']])}" class="btn btn-xs btn-success">写入</a>
				</td>
			</tr>
			{/foreach}
			</tbody>
		</table>
		<div class="panel-footer">{$list->links()}</div>

	</div>


</div>

{include file='public/footer.html'}
</body>
</html>